Skip to content

dgb: fenced DGB-side AuxPoW merged-mining coinbase commitment builder (phase DB) - #475

Merged
frstrtr merged 1 commit into
masterfrom
dgb/doge-mm-db-commitment
Jun 25, 2026
Merged

dgb: fenced DGB-side AuxPoW merged-mining coinbase commitment builder (phase DB)#475
frstrtr merged 1 commit into
masterfrom
dgb/doge-mm-db-commitment

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 25, 2026

Copy link
Copy Markdown
Owner

What this does

Adds the first shippable slice of DGB+DOGE merged-mining phase DB: a fenced, header-only DGB-side AuxPoW merged-mining coinbase-commitment builder plus a byte-layout KAT.

src/impl/dgb/coin/aux_doge_mm_commitment.hppdgb::coin::build_aux_mm_commitment(aux_merkle_root, merkle_size, merkle_nonce) returns the 44-byte commitment blob in the canonical layout:

fa be 6d 6d || aux_merkle_root(32, big-endian) || merkle_size(4 LE) || merkle_nonce(4 LE)

Mirrors LTC / canonical layout

Byte-identical to the neutral producer build_auxpow_commitment (src/c2pool/merged/merged_mining.cpp) and to the layout the LTC verify path decodes (src/impl/ltc/share_check.hpp verify_merged_coinbase_commitment): the 32-byte aux root is emitted big-endian (reversed from the internal little-endian uint256 word image), and size/nonce are emitted little-endian — exactly the order the verifier reads them back. Emitting in this order is what makes a DGB-as-parent coinbase verifiable by the existing aux machinery with zero byte divergence.

KAT is non-circular

src/impl/dgb/test/aux_doge_mm_commitment_test.cpp pins the exact bytes for 3 fixed (root, size, nonce) inputs (plus a size/magic structural check). Goldens are hand-constructed from the raw inputs (magic literal + reversed root + manual LE split), not by re-invoking the builder, so the test is a true layout anchor a re-shaped builder cannot self-confirm. Each case additionally pins a fully literal hex image.

KAT result: 4/4 PASS in the default arm AND 4/4 PASS in the -DAUX_DOGE arm.

Fenced / NOT rewired

The builder is a pure value transform with no live caller; the work-source / mint path is untouched. Wiring it into coinbase construction is the follow-on DB slice (operator/integrator-gated).

Isolation

Writes only under src/impl/dgb/ (plus the required build.yml --target allowlist line — registering the test in both the default and ASan allowlist arms so it is built, not a NOT_BUILT sentinel that reds master, cf. DGB #137/#143). Consumes only dgb/core types (core/uint256.hpp); includes and modifies nothing in the doge/ltc/core/bitcoin_family trees. Flag-agnostic — compiles in the default arm too.

NO self-merge

Pushed branch + PR only. Operator/integrator taps the merge.

@frstrtr
frstrtr force-pushed the dgb/doge-mm-db-commitment branch from 2e80314 to 3bb048c Compare June 25, 2026 12:40
frstrtr added a commit that referenced this pull request Jun 25, 2026
…rework)

Per integrator adjudication (core builder = MM SSOT): the AuxPoW merged-mining
commitment build is a v36-NATIVE SHARED structure, not a per-coin path. The
single producer lives in shared A-level scaffolding (c2pool/merged/
merged_mining.cpp + core/coinbase_builder.hpp) and is chain_id-parameterized;
DGB/DOGE plug in as chains. A fenced DGB builder that mirrors it is exactly the
cross-coin divergence the v36->v37 standardization goal forbids.

Drop the duplicate 44-byte build body from src/impl/dgb/coin/
aux_doge_mm_commitment.hpp. dgb::coin::build_aux_mm_commitment is now a thin
delegation that forwards verbatim to c2pool::merged::build_auxpow_commitment,
keeping a DGB-namespaced entry point with zero DGB-local layout logic. The
AUX_MM_MAGIC / AUX_MM_COMMITMENT_SIZE constants remain as reader/KAT pins.

aux_doge_mm_commitment_test.cpp keeps its non-circular hand-built fabe6d6d
goldens (3 KAT + SizeAndMagic, fully literal hex) AND now asserts each is
byte-identical to the core SSOT output (delegation drift-guard), mirroring the
NMC auxpow_merkle_test SSOT guard. This pins DGBs chain slot + goldens to the
one canonical builder instead of a fenced copy.

FENCED / NOT REWIRED: no live caller; mint/work-source path untouched. DB
embed-at-mint and DC dual-target wire THROUGH the core builder and are gated on
ltc-doge concurrence + operator tap. Both build arms green: 4/4 default and 4/4
-DAUX_DOGE=ON. No CMake/build.yml change (test already links c2pool_merged_mining).
@frstrtr
frstrtr force-pushed the dgb/doge-mm-db-commitment branch from 3bb048c to f06ce5b Compare June 25, 2026 12:50
frstrtr added a commit that referenced this pull request Jun 25, 2026
Pure, header-only DC decision contract the eventual DC run-loop wiring
(AUX_DOGE node seam + submit) must satisfy, landed BEFORE the seam is
touched (seam parked on #82 + ltc-doge written concurrence).

coin/aux_dual_target_select.hpp:
  - aux_mint_decision(aux_enabled, has_doge_job): embed the fabe6d6d MM
    commitment IFF aux MM enabled AND a DOGE job is present; else no-op
    (mirrors #486 embed-at-mint nullopt byte-identity).
  - select_submit(pow, dgb_target, has_doge_job, doge_target): independent
    per-path thresholds against one scrypt pow_hash (mirrors dc_proof
    DualTargetIndependentThresholds); DOGE-aux only fires when minted.
  - selection_is_consistent(): load-bearing DC<->DB guard,
    fire_doge_aux ==> embed_commitment, coupling submit back to #475/#486.

test/aux_dual_target_select_test.cpp: 5/5 KATs, non-circular goldens
(fabe6d6d tag, embed truth table, independent threshold table, no-job
suppression, the impossible DOGE-win-without-mint state). Registered in
test/CMakeLists.txt + both build.yml --target allowlists (#143 trap).

Fenced dgb/, not rewired, consumes nothing in src/impl/doge, no node
seam touch, zero consensus surface.
frstrtr added a commit that referenced this pull request Jun 25, 2026
…rework)

Per integrator adjudication (core builder = MM SSOT): the AuxPoW merged-mining
commitment build is a v36-NATIVE SHARED structure, not a per-coin path. The
single producer lives in shared A-level scaffolding (c2pool/merged/
merged_mining.cpp + core/coinbase_builder.hpp) and is chain_id-parameterized;
DGB/DOGE plug in as chains. A fenced DGB builder that mirrors it is exactly the
cross-coin divergence the v36->v37 standardization goal forbids.

Drop the duplicate 44-byte build body from src/impl/dgb/coin/
aux_doge_mm_commitment.hpp. dgb::coin::build_aux_mm_commitment is now a thin
delegation that forwards verbatim to c2pool::merged::build_auxpow_commitment,
keeping a DGB-namespaced entry point with zero DGB-local layout logic. The
AUX_MM_MAGIC / AUX_MM_COMMITMENT_SIZE constants remain as reader/KAT pins.

aux_doge_mm_commitment_test.cpp keeps its non-circular hand-built fabe6d6d
goldens (3 KAT + SizeAndMagic, fully literal hex) AND now asserts each is
byte-identical to the core SSOT output (delegation drift-guard), mirroring the
NMC auxpow_merkle_test SSOT guard. This pins DGBs chain slot + goldens to the
one canonical builder instead of a fenced copy.

FENCED / NOT REWIRED: no live caller; mint/work-source path untouched. DB
embed-at-mint and DC dual-target wire THROUGH the core builder and are gated on
ltc-doge concurrence + operator tap. Both build arms green: 4/4 default and 4/4
-DAUX_DOGE=ON. No CMake/build.yml change (test already links c2pool_merged_mining).
@frstrtr
frstrtr force-pushed the dgb/doge-mm-db-commitment branch from f06ce5b to 172fa23 Compare June 25, 2026 15:37
…rework)

Per integrator adjudication (core builder = MM SSOT): the AuxPoW merged-mining
commitment build is a v36-NATIVE SHARED structure, not a per-coin path. The
single producer lives in shared A-level scaffolding (c2pool/merged/
merged_mining.cpp + core/coinbase_builder.hpp) and is chain_id-parameterized;
DGB/DOGE plug in as chains. A fenced DGB builder that mirrors it is exactly the
cross-coin divergence the v36->v37 standardization goal forbids.

Drop the duplicate 44-byte build body from src/impl/dgb/coin/
aux_doge_mm_commitment.hpp. dgb::coin::build_aux_mm_commitment is now a thin
delegation that forwards verbatim to c2pool::merged::build_auxpow_commitment,
keeping a DGB-namespaced entry point with zero DGB-local layout logic. The
AUX_MM_MAGIC / AUX_MM_COMMITMENT_SIZE constants remain as reader/KAT pins.

aux_doge_mm_commitment_test.cpp keeps its non-circular hand-built fabe6d6d
goldens (3 KAT + SizeAndMagic, fully literal hex) AND now asserts each is
byte-identical to the core SSOT output (delegation drift-guard), mirroring the
NMC auxpow_merkle_test SSOT guard. This pins DGBs chain slot + goldens to the
one canonical builder instead of a fenced copy.

FENCED / NOT REWIRED: no live caller; mint/work-source path untouched. DB
embed-at-mint and DC dual-target wire THROUGH the core builder and are gated on
ltc-doge concurrence + operator tap. Both build arms green: 4/4 default and 4/4
-DAUX_DOGE=ON. No CMake/build.yml change (test already links c2pool_merged_mining).
@frstrtr
frstrtr force-pushed the dgb/doge-mm-db-commitment branch from 172fa23 to bdfbae7 Compare June 25, 2026 16:31
frstrtr added a commit that referenced this pull request Jun 25, 2026
Pure, header-only DC decision contract the eventual DC run-loop wiring
(AUX_DOGE node seam + submit) must satisfy, landed BEFORE the seam is
touched (seam parked on #82 + ltc-doge written concurrence).

coin/aux_dual_target_select.hpp:
  - aux_mint_decision(aux_enabled, has_doge_job): embed the fabe6d6d MM
    commitment IFF aux MM enabled AND a DOGE job is present; else no-op
    (mirrors #486 embed-at-mint nullopt byte-identity).
  - select_submit(pow, dgb_target, has_doge_job, doge_target): independent
    per-path thresholds against one scrypt pow_hash (mirrors dc_proof
    DualTargetIndependentThresholds); DOGE-aux only fires when minted.
  - selection_is_consistent(): load-bearing DC<->DB guard,
    fire_doge_aux ==> embed_commitment, coupling submit back to #475/#486.

test/aux_dual_target_select_test.cpp: 5/5 KATs, non-circular goldens
(fabe6d6d tag, embed truth table, independent threshold table, no-job
suppression, the impossible DOGE-win-without-mint state). Registered in
test/CMakeLists.txt + both build.yml --target allowlists (#143 trap).

Fenced dgb/, not rewired, consumes nothing in src/impl/doge, no node
seam touch, zero consensus surface.
@frstrtr
frstrtr merged commit a651aaa into master Jun 25, 2026
33 checks passed
frstrtr added a commit that referenced this pull request Jun 25, 2026
Pure, header-only DC decision contract the eventual DC run-loop wiring
(AUX_DOGE node seam + submit) must satisfy, landed BEFORE the seam is
touched (seam parked on #82 + ltc-doge written concurrence).

coin/aux_dual_target_select.hpp:
  - aux_mint_decision(aux_enabled, has_doge_job): embed the fabe6d6d MM
    commitment IFF aux MM enabled AND a DOGE job is present; else no-op
    (mirrors #486 embed-at-mint nullopt byte-identity).
  - select_submit(pow, dgb_target, has_doge_job, doge_target): independent
    per-path thresholds against one scrypt pow_hash (mirrors dc_proof
    DualTargetIndependentThresholds); DOGE-aux only fires when minted.
  - selection_is_consistent(): load-bearing DC<->DB guard,
    fire_doge_aux ==> embed_commitment, coupling submit back to #475/#486.

test/aux_dual_target_select_test.cpp: 5/5 KATs, non-circular goldens
(fabe6d6d tag, embed truth table, independent threshold table, no-job
suppression, the impossible DOGE-win-without-mint state). Registered in
test/CMakeLists.txt + both build.yml --target allowlists (#143 trap).

Fenced dgb/, not rewired, consumes nothing in src/impl/doge, no node
seam touch, zero consensus surface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant